Repository navigation
Fix parameter type lookup during xCal serialization - #2038
shekhar4704 wants to merge 6 commits into
Conversation
|
Thanks for the pull request, @shekhar4704! A maintainer will review it shortly. |
|
One or more PR-quality checks did not pass. Review the PR Quality Checks summary in the workflow run for the failed checks and their details, then make any necessary updates. Checklist items may remain unchecked while work is in progress. Please tick each item as you complete it. If you used AI assistance, follow the project's Responsible AI use policy and provide the required disclosures. |
Insufficient dataNot enough activity yet to make a reliable assessment. This is an automated analysis by AgentScan |
6bca2e1 to
a9f08f3
Compare
niccokunzmann
left a comment
There was a problem hiding this comment.
Thank you for the PR!
I left some comments...
The bug is important to fix.
If you would like to make a few OOP adjustments, now is also the time for that. We are prior to a major release, so we can split things up a bit.
c860bf4 to
85df3f8
Compare
AI model: GPT-5.6 Luna AI use: Used AI to help analyze the failing xCal parameter serialization tests, identify the parameter/property type-map lookup issue, and draft the test and changelog changes. I reviewed and validated the changes locally.
85df3f8 to
f8f8472
Compare
niccokunzmann
left a comment
There was a problem hiding this comment.
Thank you for the changes.
Let's keep this minimal and discard my idea about the for_name function.
I left some suggestions. Please have a look and let me know what you think! Thank you!
| "sent-by": "cal-address", | ||
| "tzid": "text", | ||
| "value": "text", | ||
| # rfc 9253 parameters |
AI assistance: ChatGPT helped inspect the code, reason about the fix, and review the tests.
|
Hi @niccokunzmann, I've addressed your suggestions and pushed the updates. The relevant tests are passing, and all CI checks are now successful. Could you please review the latest changes when you get a chance? Thank you! |
niccokunzmann
left a comment
There was a problem hiding this comment.
Thank you! I left another review :)
|
|
||
| def for_parameter(self, name: str) -> type[VPROPERTY]: | ||
| """Returns the type class for a parameter.""" | ||
| return self[self.parameter_types_map.get(name.upper(), "unknown")] |
There was a problem hiding this comment.
This is really nice! So much smaller and cleaner than passing this through the other one.
Could you also add Parameters: and Returns: here according to our style guide?
| if name in self.types_map: | ||
| type_class = self.for_property(name) | ||
| else: | ||
| type_class = self.for_parameter(name) |
There was a problem hiding this comment.
This indicates that what I thought. I does the job but to make it clean, this function would also need splitting up. We can leave it here for now. Is this also used by the parameters?
|
|
||
| def test_property_name_matching_parameter_uses_property_type(): | ||
| """A property named after a parameter uses the property type.""" | ||
| event = Event.from_ical("BEGIN:VEVENT\r\nTZID:hello\r\nEND:VEVENT\r\n") |
There was a problem hiding this comment.
tzid is in both using text.
If you use rsvp, then it should be text whereas before it was boolean.
Basically, this test needs to fail on main but work here and demonstrate that you solved the issue of them getting split up.
Linked issue
Description
Fixed xCal serialization of parameters whose names overlap with property names.
Parameters are now resolved using their own parameter type mapping instead of the property type mapping. Added tests covering parameter serialization and deserialization, including parameters whose names overlap with property names.
Checklist
Additional information
The relevant xCal parameter tests pass locally: 67 passed.
The full test suite was also run, but it currently reports failures/errors, so the full-test checklist item is intentionally left unchecked.